<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=utf-8"
	import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
	String path = request.getContextPath();
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>联系人维护</title>
<script type="text/javascript">
	var path = "<%=path%>";
</script>
<script>
	$(document).ready(function() {
	/*编辑联系人*/
$('#modifyContact').click(function() { 
		$('#showContactInfo').hide();
		$('#editContact').show();
	});
$('#contactUnitName').focus(function(){
	if(String($(this).val())=='单位名称'){
		$(this).val('');
	}
	var A_top = $(this).offset().top + $(this).outerHeight(true);
	var A_left =  $(this).offset().left;
	$("select[id!=positionId]").hide();
	$("#orgTreeDiv").css({"top":A_top+"px" ,"left":A_left+"px","display":"block"});
	});
});
</script>
</head>
<body>
<div id="showContactInfo">
<input id="conId" type="hidden" value="${contact.contactId}"></input>
<table width="100%" height="32px" border="0" cellspacing="0" cellpadding="0" style="margin: 7px 0;">
	<tr>
		<td id="detail_title">${contactName}</td>
		<td id="detail_title_bg">&nbsp;</td>
		<td align="right" id="detail_edit_bg"><sec:authorize
			ifAllGranted="通讯录操作">
			<img src="<%=path%>/image/contacts/pencil.gif" id="modifyContact"
				width="16" height="16" title="编辑联系人" class="pointer" />
			<img id="delContact" src="<%=path%>/image/contacts/delete_group.gif"
				title="删除联系人" width="16" height="16" hspace="10" class="pointer" />
		</sec:authorize></td>
	</tr>
</table>
<div style="margin: 10px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0"
	class="InnerTable">
	<tr>
		<td width="60">性别：</td>
		<td>
			<c:if test="${contact.contactSex== 1031}">男</c:if>
			<c:if test="${contact.contactSex== 1032}">女</c:if>
		</td>
	</tr>
	<c:if test="${contact.birthDate != null}">
	<tr>
		<td width="60">生日：</td>
		<td><fmt:formatDate value="${contact.birthDate}"
			pattern="yyyy-MM-dd" /></td>
	</tr>
	</c:if>
	<c:if test="${organization.orgName != null || contact.contactUnit != null}">
	<tr>
		<td width="60">单位：</td>
		<td>
		<c:if test="${contact.contactType==1237}">${organization.orgName}</c:if>
		<c:if test="${contact.contactType==1238}">${contact.contactUnit }</c:if>
		</td>
	</tr>
	</c:if>
	<c:if test="${position.positionName != null || contact.unitPost != null}">
	<tr>
		<td width="60">职位：</td>
		<td>
		<c:if test="${contact.contactType==1237}">${position.positionName}</c:if>
		<c:if test="${contact.contactType==1238}"> ${contact.unitPost }</c:if>
		 </td>
	</tr>
	</c:if>
	<c:if test="${contact.contactMobile != null}">
	<tr>
		<td width="60">手机：</td>
		<td>${contact.contactMobile}</td>
	</tr>
	</c:if>
	<c:if test="${contact.homePhone != null}">
	<tr>
		<td width="60">住宅电话：</td>
		<td>${contact.homePhone}</td>
	</tr>
	</c:if>
	<c:if test="${contact.officePhone != null}">
	<tr>
		<td width="60">单位电话：</td>
		<td>${contact.officePhone}</td>
	</tr>
	</c:if>
	<c:if test="${contact.contactFax != null}">
	<tr>
		<td width="60">传真电话：</td>
		<td>${contact.contactFax}</td>
	</tr>
	</c:if>
	<c:if test="${contact.email != null}">
	<tr>
		<td width="60">电子邮件：</td>
		<td>${contact.email}</td>
	</tr>
	</c:if>
	<c:if test="${contact.officeAddress != null}">
	<tr>
		<td width="60">单位地址：</td>
		<td>${contact.officeAddress}</td>
	</tr>
	</c:if>
	<c:if test="${contact.officeCode!=null}">
	<tr>
		<td width="60">单位邮编：</td>
		<td>${contact.officeCode}</td>
	</tr>
	</c:if>
	<c:if test="${contact.homeAddress != null}">
	<tr>
		<td width="60">家庭地址：</td>
		<td>${contact.homeAddress}</td>
	</tr>
	</c:if>
	<c:if test="${contact.homeCode != null}">
	<tr>
		<td width="60">家庭邮编：</td>
		<td>${contact.homeCode}</td>
	</tr>
	</c:if>
	<c:if test="${contact.otherAddress!=null}">
	<tr>
		<td>其它地址：</td>
		<td>${contact.otherAddress}</td>
	</tr>
	</c:if>
	<c:if test="${contact.otherCode!=null}">
	<tr>
		<td>其它邮编：</td>
		<td>${contact.otherCode}</td>
	</tr>
	</c:if>
	<c:if test="${contact.content != null}">
	<tr>
		<td width="60">备注：</td>
		<td>${contact.content}</td>
	</tr>
	</c:if>
</table>
</div>
</div>

<div id="editContact" style="display: none;">
<div style="margin: 10px;">
<form action="" id="editContactForm" name="editContactForm" method="post">
<input type="hidden" name="contact.contactId" value="${contact.contactId}"></input> 
<input type="hidden" id="contactType" name="contact.contactType" value="${contact.contactType}"></input>
<input type="hidden" name="contact.contactSex" value="${contact.contactSex}"></input> 
<input type="hidden" name="contact.contactDelFlag" value="${contact.contactDelFlag}"></input>
<input type="hidden" name="contact.contactUseFlag" value="${contact.contactUseFlag}"></input>
<input type="hidden" name="contact.userInfoId" value="${contact.userInfoId}"></input>
<input type="hidden" name="contactPartTime.parttimeId" value="${contactPartTime.parttimeId}"></input>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="InnerTable">
	<tr valign="top">
		<td width="150"><input type="text" maxlength="5" class="shadow single-cell"
			name="contactName" value="${contactName}">
		</td>
		<td>&nbsp;<span class="important-field-star"> * 请谨慎修改！</span></td>
	</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="InnerTable">
	<c:if test="${contact.contactType==1237}">
		<tr valign="top">
           <td width="170">
                <input type="text" id="contactUnitName" class="shadow single-cell" value="${organization.orgName}" readonly="readonly"/>
           </td>
           <td width="100">
                <input type="hidden" name="positionUser.positionUserId" value="${positionUser.positionUserId}"></input>
     	 		<select id="positionId" name="positionUser.positionId" width="100">
     	 		<option value="">请选择</option>
     	 			<c:forEach items="${positionList}" var="postList">
     	 				<c:if test="${postList.positionId==position.positionId}">
     	 					<option value="${postList.positionId }" selected="selected">${postList.positionName}</option>
     	 				</c:if>
     	 				<c:if test="${postList.positionId!=position.positionId}">setPositionId
     	 					<option value="${postList.positionId }">${postList.positionName}</option>
     	 				</c:if>
     	 			</c:forEach>
     	 		</select>
         	</td>
         	<td>&nbsp;</td>
        </tr>
        </c:if>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="InnerTable">
	<c:if test="${contact.contactType==1238}">
		<tr valign="top">
            <td width="170">工作单位及职务名称：</td>
            <td>&nbsp;</td>
        </tr>
		<tr valign="top">
			<td width="170"><input type="text" id="contactUnitWai" class="shadow single-cell" name="contact.contactUnit" value="${contact.contactUnit}" /></td>
			<td><input type="text" class="shadow single-cell"id="unitPost" name="contact.unitPost" value="${contact.unitPost}" /></td>
		</tr>
		 <tr valign="top">
            <td width="170">党派及社会兼职：</td>
            <td>&nbsp;</td>
         </tr>
		<tr valign="top">
			<td width="170">
				<input type="text" id="unit" class="shadow single-cell" name="contactPartTime.unit" value="${contactPartTime.unit}" />
			</td>
			<td>
				<input type="text" class="shadow single-cell" id="position" name="contactPartTime.position" value="${contactPartTime.position}" />
			</td>
		</tr>
	</c:if>
	</table>
	
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="InnerTable">
	<c:if test="${contact.contactType==1237}">
		<tr valign="top">
        	<td>职&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;级：
        		<select id="contactJobClassNei" name="contact.contactJobClass">
					<c:forEach var="contactJobClass" items="${contactJobClassList}">
						<c:if test="${contactJobClass.dataValueId==contact.contactJobClass}">
							<option selected="selected" value="${contactJobClass.dataValueId}">${contactJobClass.value}</option>
						</c:if>
						<c:if test="${contactJobClass.dataValueId!=contact.contactJobClass}">
							<option value="${contactJobClass.dataValueId}">${contactJobClass.value}</option>
						</c:if>
					</c:forEach>
				</select>
             </td>
             <td>&nbsp;</td>
        </tr>
	</c:if>
	<tr valign="top">
		<td>政治面貌：
			<select id="contactPoliticalStatusNei" name="contact.contactPoliticalStatus">
				<c:forEach var="contactPoliticalStatus" items="${contactPoliticalStatusList}">
					<c:if test="${contactPoliticalStatus.dataValueId==contact.contactPoliticalStatus}">
						<option selected="selected" value="${contactPoliticalStatus.dataValueId}">${contactPoliticalStatus.value}</option>
					</c:if>
					<c:if test="${contactPoliticalStatus.dataValueId!=contact.contactPoliticalStatus}">
						<option value="${contactPoliticalStatus.dataValueId}">${contactPoliticalStatus.value}</option>
					</c:if>
				</c:forEach>
			</select>
		</td>
		<td>&nbsp;</td>
	</tr>
	<tr valign="top">
		<td>民&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;族：
			<select id="contactNationalNei" name="contact.contactNational">
				<c:forEach var="contactNational" items="${contactNationalList}">
					<c:if test="${contactNational.dataValueId==contact.contactNational}">
						<option selected="selected" value="${contactNational.dataValueId}">${contactNational.value}</option>
					</c:if>
					<c:if test="${contactNational.dataValueId!=contact.contactNational}">
						<option value="${contactNational.dataValueId}">${contactNational.value}</option>
					</c:if>
				</c:forEach>
			</select>
		</td>
		<td>&nbsp;</td>
	</tr>
	<tr valign="top">
		<td>移动电话：
			<input type="text" id="contactMobile" class="shadow single-cell" name="contact.contactMobile" value="${contact.contactMobile}"></input>
		</td>
		<td>&nbsp;</td>
	</tr>
	<tr valign="top">
		<td>住宅电话：
			<input type="text" id="homePhone" class="shadow single-cell" name="contact.homePhone" value="${contact.homePhone}"></input>
		</td>
		<td>&nbsp;</td>
	</tr>
	<tr valign="top">
		<td>单位电话：
			<input type="text" id="officePhone" class="shadow single-cell" name="contact.officePhone" value="${contact.officePhone}"></input>
		</td>
		<td>&nbsp;</td>
	</tr>
	<tr valign="top">
		<td>传真电话：
			<input type="text" id="contactFax" class="shadow single-cell" name="contact.contactFax" value="${contact.contactFax}"></input>
		</td>
		<td>&nbsp;</td>
	</tr>
	<tr valign="top">
		<td width="240">电子邮件：
			<input type="text"  name="contact.email" class="shadow single-cell" value="${contact.email}"></input>
		</td>
		<td>&nbsp;</td>
	</tr>
	<tr valign="top">
		<td>单位地址：
		<input type="text" id="officeAddress" class="shadow single-cell" name="contact.officeAddress"
			value="${contact.officeAddress}"></input></td>
		<td>&nbsp;</td>
	</tr>
	<tr valign="top">
		<td width="240">单位邮编：
		<input type="text" id="officeCode" class="shadow single-cell" name="contact.officeCode"
			value="${contact.officeCode}"></input></td>
		<td>&nbsp;</td>
	</tr>
	<tr valign="top">
		<td>家庭地址：
		<input type="text" id="homeAddress" class="shadow single-cell" name="contact.homeAddress"
			value="${contact.homeAddress}"></input></td>
		<td>&nbsp;</td>
	</tr>
	<tr valign="top">
		<td width="240">家庭邮编：
		<input type="text" id="homeCode" class="shadow single-cell" name="contact.homeCode"
			value="${contact.homeCode}"></input></td>
		<td>&nbsp;</td>
	</tr>
	<tr valign="top">
		<td>其它地址：
		<input type="text" id="otherAddress" class="shadow single-cell" name="contact.otherAddress"
			value="${contact.otherAddress}"></input></td>
		<td>&nbsp;</td>
	</tr>
	<tr valign="top">
		<td width="240">其它邮编：
		<input type="text" id="otherCode" class="shadow single-cell" name="contact.otherCode"
			value="${contact.otherCode}"></input></td>
		<td>&nbsp;</td>
	</tr>
	<tr valign="top">
		<td>生&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;日：
		      <input type="text" id="birthDate" name="contact.birthDate"
				class="use-datepicker datepicker-low shadow single-cell" value="<fmt:formatDate value="${contact.birthDate}"  pattern= "yyyy-MM-dd"/>"
				onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true,readOnly:true})" />
		</td>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td width="170">备注：</td>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td colspan="2"><textarea name="contact.content" class="clean-html shadow nf-double-cell">${contact.content}</textarea></td>
	</tr>
	 <tr>
         <td width="170">&nbsp;</td>
         <td>&nbsp;</td>
     </tr>
	<tr>
	    <td width="170">&nbsp;</td>
		<td>
			<button id="modify" type="submit" name="modify" class="btn_green_outline">确定</button>
		</td>
	</tr>
</table>
</form>
</div>
</div>
</body>
</html>